<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ include file="/WEB-INF/jsp/common/taglibs.jsp"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<link rel="stylesheet" type="text/css" href="${ctx}/res/css/question.css">
<script type="text/javascript" src="${ctx}/res/js/survey/surveyVote/surveyVote.js"></script>
<script type="text/javascript" src="${ctx}/res/js/survey/surveyVote/voteCommon.js"></script>

<title>surveyVote</title>
</head>
<body>
	<div class="question-container">
		<form id="questionForm" method="post" action="">
			<div class="question-title">··········${survey.surveyName}··········</div>
			<div class="question-content"
				style="border-radius: 5px; box-shadow: lightblue 1px 1px 1px 1px; margin-bottom: 30px;">
				 <br>
				${survey.remark}
			</div>
			<c:forEach items="${list}" var="qt">
				<c:choose>
					<c:when test="${qt.questionType==1}">
						<div id="${qt.id}">
							<div class="question-content">${qt.questionOrder}
								. ${qt.questionContent}
								(单选)<em>*</em>
							</div>
							<span class="validateError"></span>
							<div class="item1">
								<c:forEach items="${qt.questionOptionList}" var="qo">
									<div class="${qo.optionValue} question-option uncheck"
										onclick="setQuestionValue('${qt.questionType}','${qt.id}','${qo.optionValue}')">${qo.optionValue}
								. ${qo.optionName}</div>
								</c:forEach>
								<input name="${qt.id}" type="hidden" value="" class="needCommitInput needValidate"/>
								<hr class='question-separator'></hr>
							</div>
						</div>
					</c:when>
					<c:when test="${qt.questionType==2}">
						<div id="${qt.id}">
							<div class="question-content">${qt.questionOrder}
								. ${qt.questionContent}
								(多选)<em>*</em>
							</div>
							<span class="validateError"></span>
							<div class="item1">
								<c:forEach items="${qt.questionOptionList}" var="qo">
									<div class="${qo.optionValue} question-option uncheck"
										onclick="setQuestionValue('${qt.questionType}','${qt.id}','${qo.optionValue}')">${qo.optionValue}
								. ${qo.optionName}</div>
								</c:forEach>
								<input name="${qt.id}" type="hidden" value="" class="needCommitInput needValidate" />
								<hr class='question-separator'></hr>
							</div>
						</div>
					</c:when>
					<c:when test="${qt.questionType==3}">
						<div class="question-content">${qt.questionOrder}
								. ${qt.questionContent}
						</div>
						<div class="item1 question-option2">
							<input type="text" id="${qt.id}" name="${qt.id}" value=""
								class="required needCommitInput" maxlength="10" placeholder="请输入长度不超过10位的字符" />
						</div>
						<hr class='question-separator'></hr>
					</c:when>
					<c:when test="${qt.questionType==4}">
						<div class="question-content">${qt.questionOrder}
								. ${qt.questionContent}
						</div>
						<div class="item1 question-option2">
							<textarea cols="10" rows="10" id="${qt.id}" name="${qt.id}"
								class="required" maxlength="60" placeholder="请输入长度不超过60位的字符" style="height:80px;" /></textarea>
						</div>
						<hr class='question-separator'></hr>
					</c:when>
					<c:when test="${qt.questionType==5}">
						<div class="question-content">${qt.questionOrder}
								. ${qt.questionContent}<em>*</em>
						</div>
						<span class="validateError"></span>
						<div class="item1 question-option5">
							<div class="toolButton" onclick="numDec($(this))"
								style="min-width: 45px; line-height: 25px; padding: 1px 1px 1px 1px;">Dec</div>
							<input type="text" id="${qt.id}" name="${qt.id}" style="width: 50px;"
								value="${qt.minVal}" class="required needCommitInput" valmax="${qt.maxVal}"
								valmin="${qt.minVal}" onkeyup="numInput($(this))" onpaste="return numPaste($(this))"/>
							<div class="toolButton" onclick="numAdd($(this))"
								style="min-width: 45px; line-height: 25px; padding: 1px 1px 1px 1px;">Add</div>
						</div>
						<hr class='question-separator'></hr>
					</c:when>
					<c:when test="${qt.questionType==6}">
						<div id="${qt.id}">
							<div class="question-content">${qt.questionOrder}
								. ${qt.questionContent}<em>*</em></div>
							<div class="item1">
							<span class="validateError"></span>
								<div class="item1 question-option2">
									<c:forEach items="${qt.questionOptionList}" var="qo">
										<c:if test="${qo.checkValue==true}">
											<c:if test="${qo.optionName=='Y'}">
												<input value="1" checked="checked" style="width: 60px"  type="radio" name="${qt.id}" class="needCommitInput needValidate"/>${qo.optionName}
											</c:if>
											<c:if test="${qo.optionName=='N'}">
												<input value="0" checked="checked"  style="width: 60px" type="radio" name="${qt.id}" class="needCommitInput needValidate"/>${qo.optionName}
											</c:if>
										</c:if>
										<c:if test="${qo.checkValue==false}">
											<c:if test="${qo.optionName=='Y'}">
												<input value="1" style="width: 60px" type="radio" name="${qt.id}"  class="needCommitInput needValidate"/>${qo.optionName}
											</c:if>
											<c:if test="${qo.optionName=='N'}">
												<input value="0" style="width: 60px" type="radio" name="${qt.id}"  class="needCommitInput needValidate"/>${qo.optionName}
											</c:if>
										</c:if>
			                        </c:forEach>
								</div>
							</div>
						</div>
					</c:when>
				</c:choose>
			</c:forEach>
			<p style="text-align: center" />
			<center>
				<div class="toolButton" onclick="submitQuestionForm();">确定</div>
				<div class="toolButton" onclick="resetQuestion();">重置</div>
			</center>
			</p>
		</form>
	</div>
	<form id="loadSurveyList" method="post" action="${ctx}/survey/surveyList/loadSurveyList.do">
		<input type="hidden" name="type" value="alreadyVoted"/>
	</form>
</body>
</html>